1. Field of the Invention
The present invention generally relates to data processing and, more particularly, to managing execution of complex data access operations in a data processing system.
2. Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (DBMS) that uses relational techniques for storing and retrieving data. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways. A distributed database is one that can be dispersed or replicated among different points in a network. An object-oriented programming database is one that is congruent with the data defined in object classes and subclasses.
Regardless of the particular architecture, a DBMS can be structured to support a variety of different types of operations for a requesting entity (e.g., an application, the operating system or an end user) to retrieve, add, modify and delete information being stored and managed by the DBMS. Standard database access methods support these operations using high-level query languages, such as the Structured Query Language (SQL).
The term “query” denominates a set of commands that cause execution of operations for retrieving data from a stored database. SQL supports four types of query operations, i.e., SELECT, INSERT, UPDATE and DELETE. A SELECT operation retrieves data from a database, an INSERT operation adds new data to a database, an UPDATE operation modifies data in a database and a DELETE operation removes data from a database.
One difficulty when dealing with SQL query operations is the implementation of more complex data access operations. More specifically, while the SQL query operations achieve good performance when being run as single query operations, there is often a need for a requesting entity to perform more complex data access operations. Such complex data access operations generally go beyond the functions provided by the single SQL operations. An exemplary complex operation is an operation that will first attempt an update operation and then perform an insert operation if the data to update is not already present. Another exemplary complex operation will first perform a delete operation to delete an existing set of data before inserting new (replacement) data. Still another exemplary complex operation is an operation that will first retrieve and copy a set of existing data to be used as input to an insert operation which inserts the copied data into the database.
One approach consists in implementing such complex data access operations using a combination of more basic single query operations. To this end, the requesting entity (e.g., an application) developers need to implement implementation schemas representing a series of single query operations which are suitable to implement the desired behavior of the complex data access operations. However, dependent on the database and the complex data access operations which are executed against the database, different implementation schemas for a given complex data access operation can lead to different query operation performances.
For example, assume a complex data access operation representing an update operation that will perform an insert operation if data to update is not already present. The complex data access operation is to be executed 100,000 times against a data repository (e.g., a database) in a data processing system. Furthermore, the complex data access operation is implemented in a corresponding DBMS using single SQL query operations. Assume now that at each execution of the complex data access operation an UPDATE query operation is initially executed for updating the database. Assume further that at each execution of the UPDATE operation the data to be updated is not present in the database. Thus, at each execution of the UPDATE operation a subsequent execution of an INSERT query operation is required to insert the data into the database. Consequently, at each execution of the complex data access operation two single SQL query operations are performed, first an UPDATE operation that fails and then an INSERT operation that completes successfully. This leads to a total of 200,000 single query operations which are performed when executing the complex data access operation 100,000 times against the database. Consequently, this implementation schema introduces significant overhead to the DBMS for managing 100,000 executions of failing UPDATE query operations, including processing of the operations and corresponding return (error) codes.
Therefore, there is a need for an efficient mechanism for implementing complex data access operations. Furthermore, there is a need for an effective mechanism for managing execution of complex data access operations against a data repository in a data processing system.